package com.yinp.proapp.module.customview.simpleness_view.activity;

import android.view.View;

import com.yinp.proapp.R;
import com.yinp.proapp.base.activity.AppBaseActivity;
import com.yinp.proapp.databinding.ActivitySimplenessViewBinding;
import com.yinp.proapp.utils.StatusBarUtil;

public class SimplenessViewActivity extends AppBaseActivity<ActivitySimplenessViewBinding> {

    @Override
    protected void initViews() {
        bd.header.headerBackTitle.setText("简单自定义view");
        initClick(bd.tvChangeOne, bd.ccllPoint);
        setStatusBarHeight(StatusBarUtil.getStatusBarHeight(mContext));
    }

    private int count = 0;
    private int[] colors = {R.color.green, R.color._8a8a8a, R.color.black, R.color.ff4d4d};

    @Override
    public void onClick(View v) {
        super.onClick(v);
        if (v == bd.tvChangeOne) {
            bd.ccvPoint.changeColor(mContext, R.color.blue);
        } else if (v == bd.ccllPoint) {
            bd.ccllPoint.changeColor(mContext, colors[count]);
            bd.tvChangeTwo.setText(String.valueOf(count++));
            if (count == 4) {
                count = 0;
            }
        }
    }
}